const fs = require('fs');

fs.readFile('./data_json/goods.json','utf8',function(err,data){
  let newData = JSON.parse(data);
  let pushData = [];
  let i =0;
  newData.RECORDS.map(function(value,index){
    if(value.IMAGE1!== null){
        i++;
       // console.log(value.NAME);
        pushData.push(value);
    }
  });
  console.log(i);
  //console.log(pushData);
  fs.writeFile('./newData.json',JSON, JSON.stringify(pushData),function(err){
    if(err) console.log('写入文件错误');
    else console.log('写入文件成功')
})
})

